<?php
session_start();
require_once("koneksi.php");
$email_admin = $_POST['email_admin'];
$pass_admin = $_POST['password_admin'];
$cekadmin = mysql_query("SELECT * FROM admin WHERE email_admin = '$email_admin'");
$jumlah = mysql_num_rows($cekadmin);
$hasil = mysql_fetch_array($cekadmin);
if($jumlah == 0) {
echo "Email Belum Terdaftar!<br/>";

} else {
if($pass_admin <> $hasil['password_admin']) 
{
	echo ("<SCRIPT LANGUAGE='JavaScript'>
        window.alert('You have entered an invalid password. Enter the correct details and try again. Do not forget that the password is case sensitive')
        window.location.href='index.php'
        </SCRIPT>"); 
	
	
} 
else
{
	$_SESSION['email_admin'] = $hasil['email_admin'];
	
	header ('location:index.php');
	
}
}
?>